package com.generalbackend.role.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.generalbackend.role.model.entity.Permission;
import com.generalbackend.role.model.query.PermissionQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* ClassName: Permission
* @Description 菜单权限表Mapper
* @author tim.xie
* @date 2021-12-10 11:01
*/

@Mapper
@Repository
public interface PermissionMapper extends BaseMapper<Permission>{

    /**
    * 根据条件查询列表
    * @return
    */
    List<Permission> list(Page<Permission> page, @Param("queryOption") PermissionQuery permissionQuery);

    /**
     * 查询指定用户的权限
     * @param userId
     * @return
     */
    List<Permission> getPermissionByUserId(@Param("userId")Long userId);


}
